Listing 3 Adding the tween sample to the media and the media to the track
// add the sample to the tween media
BeginMediaEdits (md);
AddMediaSample (md, container, 0,
GetHandleSize(container), kSampleDuration, desc, 1, 0, nil);
EndMediaEdits(md);
// dispose of the sample description handle and the atom container
DisposeHandle ((Handle)desc);
QTDisposeAtomContainer(container);
// add the media to the track
InsertMediaIntoTrack(t, 0, 0, kSampleDuration, kFix1);
Once you have added the tween media to its track, you need to call the AddTrackReference function to create a link between the tween track to the receiving track. AddTrackReference returns the index of the reference it creates.
The sample code shown in Listing 4 retrieves the sound track from a movie and calls AddTrackReference to create a link between the tween track ( t ) and the sound track. The reference index is returned in the parameter referenceIndex .
| Previous | Chapter Contents | Chapter Top | Next |